import request from '@/utils/request'

// 查询预订列表
export function listBookings(query) {
  return request({
    url: '/hj/bookings/list',
    method: 'get',
    params: query
  })
}

// 查询预订详细
export function getBookings(bookingId) {
  return request({
    url: '/hj/bookings/' + bookingId,
    method: 'get'
  })
}

// 新增预订
export function addBookings(data) {
  return request({
    url: '/hj/bookings',
    method: 'post',
    data: data
  })
}

// 修改预订
export function updateBookings(data) {
  return request({
    url: '/hj/bookings',
    method: 'put',
    data: data
  })
}

// 删除预订
export function delBookings(bookingId) {
  return request({
    url: '/hj/bookings/' + bookingId,
    method: 'delete'
  })
}

//提交学生申请
export  function  submitBooking(bookingId){
  return request({
    url: '/hj/bookings/submitBooking/' + bookingId,
    method: 'get'
  })
}

// 查询未审批学生信息列表
export function listBookingsNo(query) {
  return request({
    url: '/hj/bookings/listNo',
    method: 'get',
    params: query
  })
}

// 查询学生信息详细和批注
export function getBookingComment(bookingId) {
  return request({
    url: '/hj/bookings/getBookingComment/' + bookingId,
    method: 'get'
  })
}

// 审批预约信息
export function approveBookings(data) {
  return request({
    url: '/hj/bookings/editnoapprove',
    method: 'post',
    data: data
  })
}

// 查询完成审批预约信息列表
export function listBookingsFinished(query) {
  return request({
    url: '/hj/bookings/listFinished',
    method: 'get',
    params: query
  })
}